﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using FwProject.ShoppingMall.EventAdvertising;

namespace FwProject.ShoppingMall.Shop
{

    #region ViewSecondkill视图的sql 商城秒杀商品
    //select a.Id, a.ShopProductId, a.SecondkillTitle, a.SecondkillSingleCount,
    //a.SecondkillPrice, a.SecondkillBeginTime, a.SecondkillEndTime,
    //b.ShopTypeid, d.TypeName ShopTypeName, b.ProductName, e.TypeName ProductTypeName,
    //b.ProductNumber, b.MarketPrice,
    //b.ProductDetails,
    //b.SpcecostPrice,
    //b.SpceWeight, b.Brandid, c.BrandName,
    //b.Unit, b.IsGrounding,
    //b.ShopSupplierid, f.SupplierAddress, f.SupplierName, f.SupplierTel,
    //b.ShopProductFlag
    //from Shop_Secondkill a left join ShopProduct b on a.ShopProductId= b.Id left JOIN Brand c ON
    //b.Brandid= c.Id left join ShopType d on b.ShopTypeid= d.Id left join ProductType e on d.Parentid= e.Id
    //left join shop_supplier f on b.ShopSupplierid= f.Id
    #endregion

    /// <summary>
    /// 商品表
    /// </summary>
    [Table("ViewSecondkill")]
    public class ViewSecondkill : Entity<Guid>
    {   
        /// <summary>
        /// 商品分类id
        /// </summary>
        public Guid ShopTypeid { get; set; }
        /// <summary>
        /// 商品分类名称
        /// </summary>
        public string ShopTypeName { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        public string ProductName { get; set; }
        /// <summary>
        /// 类型名称名称
        /// </summary>
        public string ProductTypeName { get; set; }
        /// <summary>
        /// 产品编号
        /// </summary>
        public string ProductNumber { get; set; }
        /// <summary>
        /// 市场价格
        /// </summary>
        public decimal MarketPrice { get; set; }
        /// <summary>
        /// 商品明细
        /// </summary>
        public string ProductDetails { get; set; }
        /// <summary>
        /// 规格价格
        /// </summary>
        public decimal SpcecostPrice { get; set; }
        /// <summary>
        /// 规格重量
        /// </summary>
        public float SpceWeight { get; set; }
        /// <summary>
        /// 品牌id
        /// </summary>
        public Guid? Brandid { get; set; }
        /// <summary>
        /// 品牌名称
        /// </summary>
        public string BrandName { get; set; }
        /// <summary>
        /// 单位
        /// </summary>

        public string Unit { get; set; }

        /// <summary>
        /// 是否上架
        /// </summary>
        public bool IsGrounding { get; set; } = true;

        /// <summary>
        /// 供应商id
        /// </summary>
        public Guid ShopSupplierid { get; set; }

        /// <summary>
        /// 供应商名称
        /// </summary>
        
    
        public string SupplierName { get; set; }

        /// <summary>
        /// 供应商电话
        /// </summary>
        
        public string SupplierTel { get; set; }

        /// <summary>
        /// 供应商地址
        /// </summary>
    
        public string SupplierAddress { get; set; }
        /// <summary>
        /// 销售模式
        /// </summary>
        public ShopProductFlag ShopProductFlag { get; set; } = ShopProductFlag.正常;
        /// <summary>
        /// 商品Id
        /// </summary>
        public Guid ShopProductId { get; set; }
        /// <summary>
        /// 秒杀价格
        /// </summary>
        public decimal SecondkillPrice { get; set; } = 0m;

        /// <summary>
        /// 秒杀总的仓库数量
        /// </summary>
        public int SecondkillCount { get; set; }

        /// <summary>
        /// 每个订单最大购买数
        /// </summary>
        public int SecondkillSingleCount { get; set; }

        /// <summary>
        /// 秒杀开始时间
        /// </summary>
        public DateTime SecondkillBeginTime { get; set; }

        /// <summary>
        /// 秒杀结束时间
        /// </summary>
        public DateTime SecondkillEndTime { get; set; }

        /// <summary>
        /// 秒杀标题
        /// </summary>
        public string SecondkillTitle { get; set; }

    }
}
